<%@ page language="java" errorPage="/error.jsp" contentType="text/html; charset=utf-8"%>
<meta charset='utf-8'>
<%@ include file="taglib.jsp" %>
<html>
<head>
    <title>ADD student</title>
</head>
<body>
<div class="img">
    <a href="/productshop" align="center">
        <img src='<c:url value = "/image/base/back_black.png"/>' width="65" alt="back" title="back"/>
    </a>
</div>

<form method ="post">
    <table align="center" width="40%">
        <input type="hidden" name = "id" value="${student.id}">
        <tr>
            <td colspan="2" align="center"><h1>Add student</h1></td>
        </tr>
        <tr>
            <td>Student name:</td>
            <td><input type="text" name="name" value="${student.name}"></td>
        </tr>
        <tr>
            <td>Kathedra:</td>
            <td><select name="kathedra">
                <c:forEach var="item" items="${kathedraList}">
                    <option value="${item.id}"
                            <c:if test="${student.kathedra.id == item.id}">
                                selected
                            </c:if>
                            >${item.name}</option>
                </c:forEach>
            </select></td>
        </tr>
        <tr>
            <td>date enter:</td>
            <td>
                <input name="enterDate" type="date"
                       value="<fmt:formatDate value="${student.dateEnter}" pattern="yyyy-MM-dd" />"/>
                <fmt:formatDate value="${item.dateEnter}" pattern="yyyy-MM-dd" />
            </td>
        </tr>
        <tr>
            <td>date finish:</td>
            <td>
                <input name="finishDate" type="date"
                       value="<fmt:formatDate value='${student.dateFinish}' pattern='yyyy-MM-dd' />"/>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="SAVE">
            </td>
        </tr>
    </table>
</form>



</body>
</html>